# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=php83-pecl-protobuf
_extname=protobuf
pkgver=4.28.3
pkgrel=0
pkgdesc="PHP 8.3 extension: Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data."
url="https://pecl.php.net/package/protobuf"
arch="all"
license="BSD-3-Clause"
_phpv=83
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir/$_extname-$pkgver"
provides="php7-protobuf=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-protobuf" # for backward compatibility

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=php-config$_phpv
	make
}

check() {
	# Test suite is not a part of pecl release.
	$_php -d extension=modules/$_extname.so --ri $_extname
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/$_php/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
9c784c5e0e32fa795f86ab961664f93cb4b137ee5990e93383794c94252baceae4547ee5e1298f53bc8c22f80220987eb9a3fd7f21943d4a58e0fc04b4395289  php-pecl-protobuf-4.28.3.tgz
"
